package com.example.productserver.controller;

import com.example.productserver.entity.Product;
import com.example.productserver.service.IProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author whx
 * @date 2022/4/16
 */
@RestController
@RequestMapping("swagger")
@AllArgsConstructor
@Api(value = "商品SwaggerController", tags = "商品swagger测试接口")
public class ProductSwaggerController {

    private final IProductService productService;

    @ApiOperation(value = "列表", notes = "无参数")
    @GetMapping("list")
    public List<Product> list(){
        return productService.list();
    }

}
